import { Controller, Get, Post, Req, Res } from '@nestjs/common'
import { AnalysisService } from './analysis.service'
import { Request, Response } from 'express'

@Controller('analysis')
export class AnalysisController {
  constructor(private readonly AnaylysisService: AnalysisService) {}

  @Post('product')
  product(@Req() req: Request, @Res() res: Response) {
    const top10 = this.AnaylysisService.getTop10()
    res.send({
      top10,
    })
  }
}
